package javaer.starter.idea.window;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import org.jetbrains.annotations.NotNull;

/**
 * @author yangzhen
 * @date 2021/12/27 20:38
 * @since 1.0.0
 */
public class JavaStarterWindowFactory implements ToolWindowFactory {

    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        JavaerStarterUI javaerStarterUI = new JavaerStarterUI(project);
        ContentFactory instance = ContentFactory.getInstance();
        Content content = instance.createContent(javaerStarterUI.getUI(), null, false);
        toolWindow.getContentManager().addContent(content);
    }
}
